<?php
namespace app\common\model;

class Phonenum extends App
{
    protected $createTime = 'created';
    ##最后修改日期字段
    protected $updateTime = 'modified';
    /**
    * 关联模型
    */
    public $assoc = [
        'Tasktgroup' => [
            'type' => 'belongsTo'
        ],
    ];
    
    public function initialize()
    {        
        $this->form = [
            'id' => [
            	'type' => 'integer',
            	'name' => 'ID',
            	'elem' => 'hidden',
            ],
            'phone' => [
                'type' => 'string',
                'name' => '电话号码',
                'elem' => 'text',
            ],
            'wxid' => [
                'type' => 'string',
                'name' => '微信ID号',
                'elem' => 'text',
                'info' => '微信设置的ID号,为添加好友的唯一标识！如无留空'
            ],
            'stats' => [
                'type' => 'string',
                'name' => '状态',
                'elem' => 'select',
                'options' => [
                    '0' => '未添加',
                    '1' => '一天未回复',
                    '2' => '二天未回复',
                    '3' => '三天未回复',
                    '4' => '三天以上未回复',
                    '5' => '已回复',
                    '6' => '已发送添加信息'
                ],
               // 'list' => 'options'
            ],
//            'tasktgroup_id' => [
//                'type' => 'integer',
//                'name' => '任务分组',
//                'elem' => 'assoc_select',
//                'list' => 'assoc',
//                'foreign' => 'Tasktgroup.taskgroupname'
//            ],
            'addtime' => [
                'type' => 'date',
                'name' => '好友添加时间',
                'elem' => 'date',
            ],
            'created' => [
                'type' => 'datetime',
                'name' => '注册时间',
                'elem' =>'date',
                'list' => 'datetime'
            ],
            'modified' => [
                'type' => 'datetime',
                'name' => '修改时间',
                'elem' =>'date',
                'list' => 'datetime'
            ]

            //其他字段
        ];
        call_user_func_array(['parent', __FUNCTION__], func_get_args());
    }
    
    /**
    // 表单分组
    public $formGroup = [
        'advanced' => '高级选项'
    ];
    */
    
    /**
    * 数据验证 
    */
    protected $validate = [];
}
